package com.example.nacosclient.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * (NacosClientController)
 *
 * @version 1.0.0
 * @Author chenhao39
 * @Date 2024/4/26 16:59
 */

@RestController
public class NacosClientController {

    @Autowired
    private ProviderFeign providerFeign;

    @GetMapping("/test")
    public String test() {
        return providerFeign.invoke();

    }

    @FeignClient("nacos-provider")
    interface ProviderFeign {

        @GetMapping("invoke")
        String invoke();

    }
}
